<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
/**
 * Category view template
 *
 * @see EM_Blog_Block_Category_View
 */
?>
<?php
    $_category  = $this->getCurrentCategory();
    $displayMode = $_category->getDisplayMode();
    
    $_imgHtml   = '';
    if ($_imgUrl = $_category->getImage()) {
        $_imgHtml = '<p class="category-image"><img src="'.Mage::getBaseUrl('media').'emblog/category/'.$_imgUrl.'" alt="'.$this->escapeHtml($_category->getName()).'" title="'.$this->escapeHtml($_category->getName()).'" /></p>';
    }
	
?>
<div class="page-title category-title">
    <h1><?php echo $_category->getName() ?></h1>
</div>
<?php echo $this->getChildHtml('breadcrumbs') ?> 
<?php echo $this->getMessagesBlock()->toHtml() ?>

<?php if($_imgHtml && $_category->getShowImage() == "1"): ?>
    <?php echo $_imgHtml ?>
<?php endif; ?>

<?php if($_description=$_category->getDescription()): ?>
    <div class="category-description std">
        <?php echo $_category->getDescription() ?>
    </div>
    <?php endif; ?>

<?php if($displayMode == 1): ?>
    <?php echo $this->getCmsBlockHtml() ?>

<?php elseif($displayMode == 2): ?>
    <?php echo $this->getCmsBlockHtml() ?>
    <?php echo $this->getPostListHtml() ?>

<?php else: ?>
    <?php echo $this->getPostListHtml() ?>
<?php endif; ?>